#ifndef LASERDISPATCHER_H
#define LASERDISPATCHER_H

#include "LaserListener.h"
#include "ui/LaserFinder.h"
#include "model/Track.h"

#include <set>

class LaserDispatcher {
private:
	LaserFinder* lf;
	bool finished;
	unsigned empty_count;
	LaserEvent current_event;
	unsigned empty_count_treshold;
	
	std::set<LaserListener*> listeners;

	void notifyListeners() const;
public:
	LaserDispatcher(LaserFinder* lf);
	LaserDispatcher(LaserFinder* lf, unsigned emptyCountTreshold);
	bool addListener(LaserListener* l);
	void start();
};

#endif
